Is it possible to have editable listView?

Is it possible to have editable listView?

 

I just want to copy the contents in the rows. Not by scripting by selecting the value and ctrl+c.

 

Is there any special option available?

 


BrownK - Fri Aug 23 06:15:49 EDT 2013

Re: Is it possible to have editable listView?
Tony_Goodman - Fri Aug 23 06:52:57 EDT 2013

It is not possible to select text from a list view.

 

One possible solution is to add a callback that displays another dialog containing the selected text in an editable text box.

Here is some example code:

 

DB db = null
DBE dbeListView = null
DB dbChild = null
string dummy[] = { }
 
void doSelect(DBE dbe, int i)
{
}
 
void doDeselect(DBE dbe, int i)
{
}
 
void doActivate(DBE dbe, int i)
{
dbChild = create("Value")
 
text(dbChild, "", get(dbeListView, i), 50, false)
 
realize(dbChild)
block(dbChild)
}
 
db = create("ListView")
 
dbeListView = listView(db, 0, 190, 15, dummy)
 
realize(db)
 
insertColumn(dbeListView, 0, "", 160, iconNone)
insert(dbeListView, 0, "Text in first row", iconNone)
insert(dbeListView, 1, "Text in second row", iconNone)
 
set(dbeListView, doSelect, doDeselect, doActivate)
show(db)
 

Re: Is it possible to have editable listView?
llandale - Fri Aug 23 14:16:38 EDT 2013

Tony_Goodman - Fri Aug 23 06:52:57 EDT 2013

It is not possible to select text from a list view.

 

One possible solution is to add a callback that displays another dialog containing the selected text in an editable text box.

Here is some example code:

 

DB db = null
DBE dbeListView = null
DB dbChild = null
string dummy[] = { }
 
void doSelect(DBE dbe, int i)
{
}
 
void doDeselect(DBE dbe, int i)
{
}
 
void doActivate(DBE dbe, int i)
{
dbChild = create("Value")
 
text(dbChild, "", get(dbeListView, i), 50, false)
 
realize(dbChild)
block(dbChild)
}
 
db = create("ListView")
 
dbeListView = listView(db, 0, 190, 15, dummy)
 
realize(db)
 
insertColumn(dbeListView, 0, "", 160, iconNone)
insert(dbeListView, 0, "Text in first row", iconNone)
insert(dbeListView, 1, "Text in second row", iconNone)
 
set(dbeListView, doSelect, doDeselect, doActivate)
show(db)
 

Added a couple "Louie" DBEs including a "CopyToClipboard" button.  You could "hide(dbeLouie1)" and just leave the button.

Re: Is it possible to have editable listView?
llandale - Fri Aug 23 14:16:53 EDT 2013

Tony_Goodman - Fri Aug 23 06:52:57 EDT 2013

It is not possible to select text from a list view.

 

One possible solution is to add a callback that displays another dialog containing the selected text in an editable text box.

Here is some example code:

 

DB db = null
DBE dbeListView = null
DB dbChild = null
string dummy[] = { }
 
void doSelect(DBE dbe, int i)
{
}
 
void doDeselect(DBE dbe, int i)
{
}
 
void doActivate(DBE dbe, int i)
{
dbChild = create("Value")
 
text(dbChild, "", get(dbeListView, i), 50, false)
 
realize(dbChild)
block(dbChild)
}
 
db = create("ListView")
 
dbeListView = listView(db, 0, 190, 15, dummy)
 
realize(db)
 
insertColumn(dbeListView, 0, "", 160, iconNone)
insert(dbeListView, 0, "Text in first row", iconNone)
insert(dbeListView, 1, "Text in second row", iconNone)
 
set(dbeListView, doSelect, doDeselect, doActivate)
show(db)
 

DB db = null
DBE dbeListView = null
DBE dbeLouie1 = null,
 dbeLouie2
DB dbChild = null
string dummy[] = { }
 
void btnLouieCopy(DBE dbeXX)
{ string s = get(dbeLouie1)
 print "s = [" s "]\n"
 copyToClipboard(s)
}

void doSelect(DBE dbe, int i)
{ set(dbeLouie1, get(dbeListView, i))
}
 
void doDeselect(DBE dbe, int i)
{
}
 
void doActivate(DBE dbe, int i)
{
dbChild = create("Value")
 
text(dbChild, "", get(dbeListView, i), 50, false)
 
realize(dbChild)
block(dbChild)
}
 
db = create("ListView")
 
dbeListView = listView(db, 0, 190, 15, dummy)
dbeLouie1 = field(db, "Selection", "", 15)
 beside(db)
dbeLouie2 = button(db, "CopyToClipboard", btnLouieCopy)
 
realize(db)
 
insertColumn(dbeListView, 0, "", 160, iconNone)
insert(dbeListView, 0, "Text in first row", iconNone)
insert(dbeListView, 1, "Text in second row", iconNone)
 
set(dbeListView, doSelect, doDeselect, doActivate)
show(db)

Re: Is it possible to have editable listView?
BrownK - Mon Aug 26 09:22:14 EDT 2013

llandale - Fri Aug 23 14:16:53 EDT 2013

DB db = null
DBE dbeListView = null
DBE dbeLouie1 = null,
 dbeLouie2
DB dbChild = null
string dummy[] = { }
 
void btnLouieCopy(DBE dbeXX)
{ string s = get(dbeLouie1)
 print "s = [" s "]\n"
 copyToClipboard(s)
}

void doSelect(DBE dbe, int i)
{ set(dbeLouie1, get(dbeListView, i))
}
 
void doDeselect(DBE dbe, int i)
{
}
 
void doActivate(DBE dbe, int i)
{
dbChild = create("Value")
 
text(dbChild, "", get(dbeListView, i), 50, false)
 
realize(dbChild)
block(dbChild)
}
 
db = create("ListView")
 
dbeListView = listView(db, 0, 190, 15, dummy)
dbeLouie1 = field(db, "Selection", "", 15)
 beside(db)
dbeLouie2 = button(db, "CopyToClipboard", btnLouieCopy)
 
realize(db)
 
insertColumn(dbeListView, 0, "", 160, iconNone)
insert(dbeListView, 0, "Text in first row", iconNone)
insert(dbeListView, 1, "Text in second row", iconNone)
 
set(dbeListView, doSelect, doDeselect, doActivate)
show(db)

Thank you guys :) I have one more problem when I close the dialog containing the selected text in an editable text box the screen focus is gone out of the main dialog and the dxl editor is on focus. Is there any way to sustain the focus on the main dialog ?

 

.

Re: Is it possible to have editable listView?
llandale - Mon Aug 26 14:31:24 EDT 2013

BrownK - Mon Aug 26 09:22:14 EDT 2013

Thank you guys :) I have one more problem when I close the dialog containing the selected text in an editable text box the screen focus is gone out of the main dialog and the dxl editor is on focus. Is there any way to sustain the focus on the main dialog ?

 

.

If you have a DB handle on that dialog, you can

  • raise(DB)

-Louie